package chapter4;

import java.util.Arrays;

public class VampireNumber {
	public static void findVampire() {
		int end = 100, begin = 10, i = begin, j = begin;
		while (i != end) {
			while (j != end) {
				int temp = i * j;
				if (temp > 1000 && temp % 100 != 0) {
					char source[] = new StringBuffer().append(i).append(j)
							.toString().toCharArray();
					Arrays.sort(source);
					char des[] = new StringBuffer().append(temp).toString()
							.toCharArray();
					Arrays.sort(des);
					if (new String(source).equals(new String(des)))
						System.out.println(temp);

				}
				j++;
			}
			i++;
			j = i;
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		findVampire();

	}

}
